An imaging face of an imaging device having a two-dimensional array of pixels (light-receiving element portions) such as a metal oxide semiconductor (MOS)-type imaging device is ordinarily provided with a light-receiving region for receiving light from a subject and a light-blocked optical black (OB) region disposed adjacent to the light-receiving region. The optical black region has pixels, but light is blocked from the pixels.
The optical black region is provided in order to detect the pixel values of pixels in a state where light is not received. Herein, the pixel value is obtained by photoelectrically converting the amount of light received by a pixel from a subject, and converting the resulting value into a digital value.
By providing an optical black region on an imaging face, it is accomplished that the black level in a state where light from a subject is not received is accurately detected. Accordingly, correction that subtracts the detected black level from an output signal can be performed, so that an image having a correct pixel value can be output.
A plurality of pixel values are generated in the optical black region, and a pixel value histogram obtained by statistically processing these pixel values has a bilaterally symmetric normal distribution. Herein, the average pixel value in the pixel value histogram having a bilaterally symmetric normal distribution is indicated as a pixel value in a level having the maximum frequency. That is to say, the average pixel value in the pixel value histogram is a pixel value in the center level of the pixel value histogram having a bilaterally symmetric normal distribution.
Furthermore, the average pixel value in the pixel value histogram indicates the black level indicating the pixel values of pixels in a state where light is not received.
Furthermore, the black level changes depending on the temperature of an imaging device. When the temperature is high, the pixel values of pixels on an imaging face increase, and, thus, the black level also increases. In an imaging device, correction is performed in consideration of such a change in the black level.
For example, Patent Literature 1 discloses an image processing method including the steps of: forming a pixel value histogram of pixels in an optical black region of an imaging face of a solid imaging device; clipping negative pixel values in the formed pixel value histogram to where a pixel value is zero; taking a median in the pixel value histogram after clipping as a black level; and performing black level correction of an output signal generated at the pixel using the black level as a reference.
Herein, the clipping refers to a phenomenon in which the frequency of pixel values saturates. Hereinafter, a specific description will be given.
In the case where a voltage obtained by a photodiode photoelectrically converting light from a subject is converted into a pixel value, the range of a voltage that can be converted into a pixel value is determined in advance depending on a required sensitivity or image quality. Furthermore, in the case where the maximum voltage within the range where voltages can be converted into a pixel value is converted into a pixel value, that pixel value is defined as an upper limit.
Herein, when photoelectrically converted voltages are converted into pixel values, and the pixel values are larger than the above-described upper limit, the frequencies of the pixel values larger than the upper limit are gathered at the upper limit of the pixel value, and a saturated state occurs. This phenomenon is clipping.
Furthermore, clipping also occurs in the case where pixel values obtained from photoelectrically converted voltages are smaller than where a pixel value is zero. More specifically, this is a phenomenon in which the frequencies of pixel values smaller than where the pixel value is zero are gathered at where the pixel value is zero, and a saturated state occurs.
FIGS. 3(a) and 3(b) illustrate the image processing method described in Patent Literature 1. The description in Patent Literature 1 is as follows.
FIG. 3(a) shows a histogram before negative pixel values are clipped to where the pixel value is zero, and FIG. 3(b) shows a histogram after the negative pixel values are clipped to where the pixel value is zero. A signal processing portion calculates a black level in the following manner: in the pixel value histogram after clipping, the average pixel value in a pixel value histogram including only positive pixel values having frequencies not smaller than a predetermined threshold is taken as the black level.
Assuming that the pixel value histogram of the optical black region before the negative pixel values are clipped to where the pixel value is zero is as shown in FIG. 3(a) the average pixel value in the pixel value histogram is 2, and it is reasonable to take this value as the black level.
Hereinafter, a method for calculating the black level when the above-described predetermined frequency threshold is 4 in FIG. 3(b) showing a pixel value histogram after clipping of the optical black region will be described.
First, since the predetermined frequency threshold is set to 4, pixel values that have a frequency of 4 or more and that are not the zero pixel value are selected. Herein, according to FIG. 3(b), three pixel values consisting of pixel values 1, 2, and 3 correspond to the pixel values satisfying these conditions.
Next, the average pixel value in the pixel value histogram is obtained from these three pixel values. Herein, the average pixel value in the pixel value histogram after clipping is a pixel value at the central level of the pixel value histogram as in the case of the average pixel value in the pixel value histogram before clipping. Thus, according to FIG. 3(b), the average pixel value in the pixel value histogram after clipping is naturally 2. This value is reasonable because this is equal to the average pixel value in the pixel value histogram before the negative pixel values are clipped to the pixel value zero. As a result, the pixel value 2 corresponds to the black level in a state where light is not received.
Herein, the predetermined frequency threshold may be freely set. Furthermore, the maximum frequency may be taken as the threshold. In this case, the pixel value of a pixel having the maximum frequency is directly taken as the black level. It means that, in the example shown in FIG. 3(b), the pixel value 2 having the maximum frequency 5 is directly used as the black level,